package cn.iocoder.yudao.module.engine.service.conn;

import cn.iocoder.yudao.module.engine.model.context.EngineSessionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EngineConnectionListenerManager {

    @Autowired
    private List<IEngineConnectListener> timerServices;

    public void onConnected(EngineSessionContext sessionCtx) {
        timerServices.forEach(service ->
                service.onConnected(sessionCtx)
        );
    }

    public void onDisconnected(EngineSessionContext sessionCtx) {
        timerServices.forEach(service ->
                service.onDisconnected(sessionCtx)
        );
    }

}
